<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <div th:replace="~{/home::css_js}"></div>
</head>
<body>
<div id="wrapper">

    <div th:replace="~{/home::topbar}"></div>

    <div th:replace="~{/home::sidebar}"></div>

    <div class="main">
        <!-- MAIN CONTENT -->


        <div class="main-content">
            <div class="container-fluid">
                <div id="page-wrapper">
                    <div id="page-inner">
                        <div class="row">
                            <div class="col-md-12">
                                <h1 class="page-header">
                                    修改个人信息
                                </h1>
                            </div>
                            <div class="row">
                                <div class="col-lg-12"> <!--把col lg 12宽 分成了 左边6 右边6-->
                                    <div class="panel panel-default">
                                        <div class="panel-heading"> <!--panel顶部一整行-->
                                            管理员 [[${self.getUsername()}]] 正在修改 本人信息
                                        </div>
                                        <div class="panel-body">
                                            <div class="row">         <!--form 表单的开始-->
                                                <div class="col-lg-11">          <!--thymeleaf页面要绑定所有的url，否则报403-->
                                                    <form role="form" th:action="@{/self/modify_self_do}" method="post">
                                                        <input th:type="hidden" th:value="${self.getAdmin_id()}" name="Admin_id">
                                                        <input th:type="hidden" th:value="${self.getUsername()}" name="username">
                                                        <input th:type="hidden" th:value="${self.getPassword()}" name="password">

                                                        <div class="form-group">
                                                            <!--发现，输入文字的，选择的控件<input class="form-control">-->
                                                            <label>账号</label>
                                                            <p th:text="${self.getUsername()}"></p>
                                                            <label>管理员角色</label>
                                                            <div th:switch="${self.getState()}">
                                                                <p th:case="0" th:text="超级管理员"></p>
                                                                <p th:case="1" th:text="系统管理员"></p>
                                                                <p th:case="2" th:text="商品管理员"></p>
                                                                <p th:case="*" th:text="其他角色"></p>
                                                            </div>
                                                            <label>账号状态</label>
                                                            <div th:switch="${self.getState()}">
                                                                <p th:case="1" th:text="正常"></p>
                                                                <p th:case="*" th:text="未启用"></p>
                                                            </div>

                                                        </div>

                                                        <div class="form-group">
                                                            <!--发现，输入文字的，选择的控件<input class="form-control">-->
                                                            <label>姓名</label>
                                                            <input class="form-control" th:type="text" name="realname" th:value="${self.getRealname()}">

                                                        </div>

                                                        <div class="form-group">
                                                            <!--发现，输入文字的，选择的控件<input class="form-control">-->
                                                            <label>联系电话</label>
                                                            <input class="form-control" th:type="text" name="phone" th:value="${self.getPhone()}">
                                                        </div>
                                                        <div class="form-group">
                                                            <!--发现，输入文字的，选择的控件<input class="form-control">-->
                                                            <label>邮箱</label>
                                                            <input class="form-control" th:type="text" name="email" th:value="${self.getEmail()}">
                                                        </div>
                                                        <div class="form-group">
                                                            <label>头像</label>
                                                            <div th:switch="${self.getHead_pic()}">
                                                                <img th:case="null" src="/img/foodhead1.jpg" width="80" height="80">
                                                                <img th:case="*" th:src="@{'/head_pic/'+${self.getHead_pic()}}" width="120" height="80">
                                                            </div>
                                                        </div>

                                                        <button type="submit" class="btn btn-success">保存</button>
                                                        <a class="btn btn-primary" th:href="@{/home}">取消</a>
                                                    </form>
                                                    <!--form表单结束-->
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>
</body>
</html>